﻿using AutoMapper;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Soundteller.Application.Facade.Mappers;
using Soundteller.Common.Tests;

namespace Soundteller.Application.Facade.Tests.Unit.Mappers
{
    [TestClass]
    public class MappingConfigurationTest : TestBase
    {
        protected string MappingError { get; set; }

        protected override void Arrange()
        {
            MappingError = null;
            MappingConfiguration.Configure();
        }

        protected override void Act()
        {
            try
            {
                Mapper.AssertConfigurationIsValid();
            }
            catch (AutoMapperMappingException ex)
            {
                MappingError = ex.Message;
            }
        }

        [TestMethod]
        public void ThenNoExceptionShouldOccur()
        {
            Assert.IsNull(MappingError, MappingError);
        }
    }
}
